BigDFT.Spillage module

A module which contains the routines needed for computing the spillage values.

AU_to_A = 0.52917721092

Conversion between Atomic Units and Bohr

class MatrixMetadata(filename)[source]

This class contains the information stored in the sparse matrix metadata file.

Parameters

filename (str) – the name of the metadata file to initialize from.

atoms

a list of atoms with their positions and associated basis functions.

Type

list

matdim

the dimension of the matrix.

Type

int

get_frag_indices(system)[source]

Retrive the indices of the matrix associated with each fragment of a system.

Parameters

system (Systems.System) – the set of fragments to get the indices of.

Returns

a mapping from fragment to indices.

Return type

(dict)

serial_compute_puritybase(sfile, dfile)[source]

This routine computes the matrix K*S using python.

You will need this for computing the purity values.

Parameters
  • sfile (str) – the file name of the overlap matrix. Must be in ccs of mtx format.

  • dfile (str) – the file name of the density kernel. Must be in ccs of mtx format.

Returns

K*S

Return type

(scipy.sparse.csc, scipy.sparse.csc)

serial_compute_spillagebase(sfile, hfile)[source]

This routine computes the matrix S^{-1}*H using python.

You will need this for computing the spillage values.

Parameters
  • sfile (str) – the file name of the overlap matrix. Must be in ccs of mtx format.

  • hfile (str) – the file name of the hamiltonian. Must be in ccs of mtx format.

Returns

Sinverse * H

Return type

(scipy.sparse.csc, scipy.sparse.csc)

invert_ccs(mat)[source]

Invert a CSC matrix and restore a sparsity pattern such as it can be written without the need for large files.

Parameters

mat (csc_matrix) – the sparese matrix to invert

Returns

the inverse

Return type

csc_matrix

read_ccs(fname)[source]

Read a CCS matrix from file into a scipy csc matrix.

This routine uses the CCS matrix files that CheSS generates. :param fname: name of the file. :type fname: str

Result:

scipy.sparse.csc_matrix: the matrix in the file.